#ifndef __DRV_TIM_BASIC_H
#define __DRV_TIM_BASIC_H

#include <mm32f327xx_hal_config.h>

#define TIM_PORT                TIM6
#define TIM_IRQn                TIM6_IRQn
#define TIM_IRQHandler          TIM6_IRQHandler
#define TIM_CLK_EN()            RCC_EnableAPB1Periphs(RCC_APB1_PERIPH_TIM6, true)

#define HAL_TIM_Basic_SetPeriod(TIM, VALUE)      {TIM->ARR = VALUE;}

typedef struct{
    TIM_BASIC_Type *Instance;
    TIM_BASIC_Init_Type init;
}HAL_TIM_Basic_InitType;

extern HAL_TIM_Basic_InitType htim;

void Drv_TIM_Basic_Init(void);
void HAL_TIM_Basic_StartOnce(HAL_TIM_Basic_InitType *tim, uint16_t once_time);

#endif /* __DRV_TIM_BASIC_H */
